package com.common.shared.model;

import java.util.ArrayList;
import java.util.TreeMap;

public class Helper {
	public static void changeContent(
			TreeMap<Integer, ArrayList<Classifier>> cls, Classifier cl) {
		ArrayList<Classifier> pcls = cls.get(cl.getCltype());
		if (pcls == null) {
			return;
		}
		for (Classifier classifier : pcls) {
			if (classifier.getTypeid() == cl.getTypeid()) {
				classifier.setTypename(cl.getTypename());
				return;
			}
		}
		pcls.add(cl);
	}

	public static void changeContent(ArrayList<ClassifierType> cls,
			ClassifierType cl) {
		for (ClassifierType classifier : cls) {
			if (classifier.getId() == cl.getId()) {
				classifier.setClassifictypename(cl.getClassifictypename());
				return;
			}
		}
		cls.add(cl);
	}
}
